﻿using Business.Models;
using Business.Views;
using DH.Share.Comm.Commands;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;


namespace Business.ViewModels
{
    public class BusinessViewModel : BindableBase
    {
        public BusinessViewModel(IRegionManager regionManager)
        {
            LeftMenus = new List<LeftMenu>();
            LeftMenus.Add(new LeftMenu() { MsCount = 11, MenuName = "信息数据收集", MenuTab = "InfoView" });
            LeftMenus.Add(new LeftMenu() { MenuName = "日常业务接收", MenuTab = "DailyView" });
            LeftMenus.Add(new LeftMenu() { MenuName = "服务工单接收" });
            LeftMenus.Add(new LeftMenu() { MenuName = "事务进度跟踪" });
            LeftMenus.Add(new LeftMenu() { MenuName = "事务记录审核" });
            LeftMenus.Add(new LeftMenu() { MenuName = "业务信息询价" });
            this.regionManager = regionManager;
            NavgateParaCommand = new DelegateCommand<string>(NavgatePage);
        }
        public List<LeftMenu> leftMenus;
        public List<LeftMenu> LeftMenus
        {
            get { return leftMenus; }
            set { leftMenus = value; RaisePropertyChanged(); }
        }
        void NavgatePage(string parameter)
        {
            object view=null;
            switch (parameter)
            {
                case "InfoView":  view = new InfoView();break;
                default: view = new MainPage();break;
            }
            MenuCommand.OpenInfoView(this.regionManager,view);
        }
        public DelegateCommand<string> NavgateParaCommand { get; set; }

        private readonly IRegionManager regionManager;

        private string mindex;
        public string Mindex
        {
            get { return mindex; }
            set { mindex = value; RaisePropertyChanged(); }
        }
    }
}

